#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <string>

using namespace std;

#include <qlabel.h>
#include <qlineedit.h>
#include <QComboBox>
#include <QFileDialog>
#include <QCheckBox>
#include <QPushButton>
#include <QMessageBox>
#include <QDialog>
//#include <qpixmap.h>

class SettingsDialog : public QDialog {
    Q_OBJECT
public:
    SettingsDialog( string *account, 
                    string *password, 
                    string *server,
                    string *homeChannel,
                    string *cdkey,
                    string *starcraftVersion,
                    string *hashfileLocation1,
                    string *hashfileLocation2,
                    string *hashfileLocation3 );

  
    string getUsername();
    string getPassword();
    string getServer();
    string getHomeChannel();
    string getCdkey();
    string getStarcraftVersion();
    string getHashfileLocation1();
    string getHashfileLocation2();
    string getHashfileLocation3();
      
private slots:
    void browseForHashfileLocation1ButtonClicked();
    void browseForHashfileLocation2ButtonClicked();
    void browseForHashfileLocation3ButtonClicked();
    void loginButtonClicked();
    void exitButtonClicked();
  
private:
    const QString saveDataFilename; // Filename that holds the saved settings.
    const Q_UINT32 fileVersion;     // File format version.

    enum { MagicNumber = 0x22ce622a };  // This is stored as the header
                                        // to every data file saved, to
                                        // ensure it's a valid saved file.

    bool loadBool( QDataStream& in );   // Gets a C++ bool from a QDataStream.


    bool loadSettings();
    void loadDefaultSettings();
    bool saveSettings();


    QLabel *usernameLabel_;
    QLabel *passwordLabel_;
    QLabel *serverLabel_;
    QLabel *homeChannelLabel_;
    QLabel *cdkeyLabel_;
    QLabel *starcraftVersionLabel_;
    QLabel *hashfileLocation1Label_;
    QLabel *hashfileLocation2Label_;
    QLabel *hashfileLocation3Label_;

    QLineEdit *usernameLineEdit_;
    QLineEdit *passwordLineEdit_;
    QLineEdit *homeChannelLineEdit_;
    QLineEdit *cdkeyLineEdit_;
    QLineEdit *starcraftVersionLineEdit_;
    QLineEdit *hashfileLocation1LineEdit_;
    QLineEdit *hashfileLocation2LineEdit_;
    QLineEdit *hashfileLocation3LineEdit_;


    QComboBox *serverSelect_;

    QPushButton *browseHashfileLocation1Button_;
    QPushButton *browseHashfileLocation2Button_;
    QPushButton *browseHashfileLocation3Button_;
    QPushButton *loginButton_;
    QPushButton *exitButton_;
  
    QCheckBox *usernameSaveCheckBox_;
    QCheckBox *passwordSaveCheckBox_;
    QCheckBox *serverSaveCheckBox_;
    QCheckBox *homeChannelSaveCheckBox_;
    QCheckBox *cdkeySaveCheckBox_;
    QCheckBox *starcraftVersionSaveCheckBox_;
    QCheckBox *hashfileLocation1SaveCheckBox_;
    QCheckBox *hashfileLocation2SaveCheckBox_;
    QCheckBox *hashfileLocation3SaveCheckBox_;

    QString qtusername_;
    QString qtpassword_;
    QString qtserver_;
    Q_UINT32 serverComboBoxIndex_;
    QString qthomeChannel_;
    QString qtcdkey_;
    QString qtstarcraftVersion_;
    QString qthashfileLocation1_;
    QString qthashfileLocation2_;
    QString qthashfileLocation3_;


    bool saveUsernameEnabled_;
    bool savePasswordEnabled_;
    bool saveServerEnabled_;
    bool saveHomeChannelEnabled_;
    bool saveCdkeyEnabled_;
    bool saveStarcraftVersionEnabled_;
    bool saveHashfileLocation1Enabled_;
    bool saveHashfileLocation2Enabled_;
    bool saveHashfileLocation3Enabled_;
  
    string *username_;
    string *password_;
    string *server_;
    string *homeChannel_;
    string *cdkey_;
    string *starcraftVersion_;
    string *hashfileLocation1_;
    string *hashfileLocation2_;
    string *hashfileLocation3_;


};

#endif
